module CnSms
  module Adapter
    class Smsxchange < Base
      @client = nil

      def initialize(config)
        @client = SmsXchange.new(:username=>config['username'],:password=>config['password'],:from=>config["from"])
      end

      def send(phone,msg)
        super(phone,msg)
        @client.send(phone,msg)
        puts "sms sent phone:#{phone}. Message:#{msg}"
      end
    end
  end
end